package cn.net.yto.school.dao.entities;

import cn.net.yto.base.dao.entities.TAccount;
import lombok.Data;
import lombok.NoArgsConstructor;

import javax.persistence.*;
import java.io.Serializable;
import java.sql.Timestamp;

/**
 * tb_file 实体类
 * Created by gaojing
 * Wed Jul 18 20:11:47 CST 2018
 */
@Entity
@Table(name = "tb_file")
@Data
@NoArgsConstructor
public class TbFile implements Serializable {
    private static final long serialVersionUID = 9037855777866314723L;
    /**
     * 文件id
     */
    @Id
    @GeneratedValue(strategy = GenerationType.IDENTITY)
    @Column(name = "file_id", nullable = false, length = 11)
    private Integer id;

    /**
     * 文件归属（课程中可以上传文件，学生也可以上传学习资料）课程id从1000000开始加以区别
     */
    @ManyToOne
    @JoinColumn(name = "file_belong_to", referencedColumnName = "c_id")
    private TbCourse fileBelongTo;

    /**
     * 文件名
     */
    @Column(name = "file_name", length = 32)
    private String fileName;

    /**
     * 文件路径
     */
    @Column(name = "file_path", length = 1024)
    private String filePath;

    /**
     * 文件描述
     */
    @Column(name = "file_discrib", length = 1024)
    private String fileDiscrib;

    /**
     * 文件下载次数
     */
    @Column(name = "file_download_count", length = 11)
    private Integer fileDownloadCount;

    /**
     * 创建时间
     */
    @Column(name = "create_time")
    private Timestamp createTime;

    /**
     * 修改时间
     */
    @Column(name = "update_time")
    private Timestamp updateTime;

    /**
     * 操作员
     */
    @ManyToOne
    @JoinColumn(name = "actor", referencedColumnName = "ACCT_ID")
    private TAccount actor;

}

